//
//  AddFriendsItem.m
//  觅影
//
//  Created by  陶虹 on 16/4/9.
//  Copyright © 2016年  陶虹. All rights reserved.
//

#import "AddFriendsItem.h"
#import "RecommendFriendsModel.h"

@interface AddFriendsItem ()
@property (nonatomic, strong) NSThread *thread;
@property (nonatomic, assign) NSInteger row;
@end

@implementation AddFriendsItem

- (void)configureCellWithModel:(RecommendFriendsModel *)model{
    [self.icon setImage:[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:model.header]]] forState:UIControlStateNormal];
    self.usernameLabel.text = model.username;
    
//    self.row = row;
//    // 开辟子线程
//    if (self.thread == nil) {
//        self.thread = [[NSThread alloc] initWithTarget:self selector:@selector(threadAction:) object:nil];
//        [self.thread start];
//    }else if (self.thread.isFinished == YES){
//        self.thread = [[NSThread alloc] initWithTarget:self selector:@selector(threadAction:) object:nil];
//        [self.thread start];
//    }
}

//- (void)threadAction:(NSThread *)thread{
//    // 头像
//    UIImage *image1 = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://static.xuerendianying.com/portraits/2016/04/04/1459775117.jpg"]]];
//    UIImage *image2 = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://static.xuerendianying.com/portraits/2016/01/03/1451788707.jpg"]]];
//    UIImage *image3 = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://static.xuerendianying.com/portraits/2016/01/03/1451810992.jpg"]]];
//    UIImage *image4 = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://static.xuerendianying.com/portraits/2016/02/05/1454656551.jpg"]]];
//    UIImage *image5 = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://static.xuerendianying.com/portraits/2016/02/06/1454732576.jpg"]]];
//    UIImage *image6 = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://static.xuerendianying.com/portraits/2016/02/21/1455985741.jpg"]]];
//    UIImage *image7 = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://static.xuerendianying.com/portraits/2016/03/27/1459010242.jpg"]]];
//    UIImage *image8 = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://static.xuerendianying.com/portraits/2016/03/27/1459058417.jpg"]]];
//    UIImage *image9 = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://static.xuerendianying.com/portraits/2016/04/07/1460039089.jpg"]]];
//    UIImage *image10 = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://static.v6v7.com/img/trace/gender_2.jpg"]]];
//    UIImage *image11 = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://static.v6v7.com/img/trace/gender_1.jpg"]]];
//    UIImage *image12 = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://static.v6v7.com/img/trace/gender_1.jpg"]]];
//    self.imageArray = @[image1, image2, image3, image4, image5, image6, image7, image8, image9, image10, image11, image12];
//    
//    // 名字
//    NSString *name1 = @"johnnychen";
//    NSString *name2 = @"otso";
//    NSString *name3 = @"tasco";
//    NSString *name4 = @"散步的🐌";
//    NSString *name5 = @"呸";
//    NSString *name6 = @"睿可";
//    NSString *name7 = @"致列薛’s鸡冠花";
//    NSString *name8 = @"JanLam";
//    NSString *name9 = @"成龙大哥说你好";
//    NSString *name10 = @"华丽逆";
//    NSString *name11 = @"zch";
//    NSString *name12 = @"xxx991";
//    self.nameArray = @[name1, name2, name3, name4, name5, name6, name7, name8, name9, name10, name11, name12];
//    
//    dispatch_async(dispatch_get_main_queue(), ^{
//        
//        [self.icon setImage:self.imageArray[self.row] forState:UIControlStateNormal];
//        self.usernameLabel.text = self.nameArray[self.row];
//    });
//}

- (void)awakeFromNib {
    // Initialization code
}

@end
